﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DALScolarite 
{
    public partial class scolarite_enseignants
    {
        uvtmoyEntities ent;
        public List<scolarite_enseignants> Enseignants()
        {
            ent = new uvtmoyEntities();
            var query = from e in ent.scolarite_enseignants select e;
            return query.ToList();

        }

        public scolarite_enseignants connecter(string login, string password) { 
             ent = new uvtmoyEntities();
             var query = from e in ent.scolarite_enseignants
                         where e.login == login && e.motdepasse == password
                         select e;
             if (query.Any())
             {

                 return query.First();
             }
             else
             {
                 return null;
             }
            
        }

    }
}
